<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" href="../css/aui.css" />
    <link rel="stylesheet" href="../css/pickUp_user_filter.css">
    <link rel="stylesheet" href="../css/lCalendar.css">
    <link rel="stylesheet" href="../fonts/iconfont/iconfont.css" />
    <title>E卡列表筛选</title>

</head>

<body>
    <!-- 头部  s -->
    <header class="aui-bar aui-bar-nav aui-bar-light" style="background: #4e536c;">
        <a class="aui-pull-left aui-btn" onclick="history.go(-1)" style="color: #333;">
            <span class="aui-iconfont aui-icon-left" style="color: #FFFFFF;"></span>
        </a>
        <div class="aui-title" style="color: #FFFFFF;">E卡列表筛选</div>

    </header>
    <!--<header class="aui-bar aui-bar-nav aui-bar-light">
			<a class="aui-pull-left aui-btn" onclick="history.go(-1)" style="color: #333;">
				<span class="aui-iconfont aui-icon-left"></span>
			</a>
			<!--<div class="aui-title text">
				<input type="text" placeholder="搜索E卡卡号">
			</div>-->
    <!--<div class="aui-title" style="color: #FFFFFF;">E卡列表</div>
		</header>-->
    <!-- 头部  e -->

    <div class="content">
        <div class="choose">
            <div class="choose-time">
                <span>按E卡激活状态筛选</span>
            </div>
            <div class="btn e-btn state" style="border-bottom: 1px solid #e6e6e6;">
                <div class="aui-btn active">未激活</div>
                <div class="aui-btn">已激活</div>
                <div class="aui-btn">已过期</div>
                <div class="aui-btn hidden"></div>
            </div>
            <div class="choose-time">
                <span>按E卡激活时间筛选</span>
            </div>
            <div class="e-btn btn curDate ">
                <div class="aui-btn active">全部</div>
                <div class="aui-btn ">近7天</div>
                <div class="aui-btn">近30天</div>

                <div class="aui-btn hidden"></div>
            </div>

        </div>
    </div>
    <footer>
        <div class="  member  control">重置</div>
        <div class="  member  manage">筛选</div>
    </footer>
    <script src="../js/jquery-1.9.1.js"></script>
    <script src="../js/comment.js"></script>
    <script src="../js/accept_filter.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $(function() {
            var query = window.location.search; //获取URL地址中？后的所有字符  
            var str = decodeURI(query)
            var ttId;
            if (str[0] === '?') {
                var newstr = str.substr(1)
                ttId = JSON.parse(newstr);
            }
            var obj = JSON.parse(window.localStorage.getItem('obj'))
            var curDate, state;

            function getVal(state, curDate) {
                $(".manage").click(function() {
                    if ($(".state  .active").html() == "未激活") {
                        state = "10";

                    } else if ($(".state  .active").html() == "已激活") {
                        state = "20";

                    } else if ($(".state  .active").html() == "已过期") {
                        state = "40";

                    }

                    if ($(".curDate .active").html() == "近7天") {
                        curDate = "7";
                    } else if ($(".curDate .active").html() == "近30天") {
                        curDate = "30";
                    } else if ($(".curDate .active").html() == "全部") {
                        curDate = "0";
                    }

                    var val = {
                        ttId: ttId,
                        state: state,
                        day: curDate,
                        curpage: 1,
                        page: 10,
                    }
                    $.ajax({
                        type: "get",
                        url: url + "station/stationsublist",
                        data: val,
                        success: function(result) {
                            console.log(result)
                            var data = result.datas.StationSubList.datas;
                            data.state = val.state
                            window.location.href = "eCard_filter.html?" + val.ttId
                            window.localStorage.setItem("datas", JSON.stringify(data));
                        }
                    })
                })
            }

            getVal(state, curDate)

        })
    </script>

</body>

</html>